import time
import unittest
from BSTestRunner import BSTestRunner
if __name__ == '__main__':
    test_dir = r'..\test_cases'
    discover=unittest.defaultTestLoader.discover(test_dir,pattern='test*.py')
    report_dir=r'..\reports'
    now=time.strftime('%Y_%m_%d_%H_%M_%S')
    print(now)
    report_name=rf'{report_dir}\{now}retort.html'

    with open(report_name,mode='wb') as f:
        runner=BSTestRunner(f,title='测试报告',description='测试详情')
        runner.run(discover)